Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Application-Defined Routines

This section describes the I/O methods you can implement to handle a custom object type. Your custom methods are reported to QuickDraw 3D by your object metahandler. This section also describes how to write a file idler callback routine.

For information about defining an object metahandler and about the basic methods for handling custom objects, see the chapter "QuickDraw 3D Objects."

These I/O methods define how QuickDraw 3D handles your custom objects when reading them from or writing them to a metafile. Each distinct object in a metafile consists of a root object that determines the object's type and default data. Some types of objects can have child objects attached to them, which add information to the parent object or override the parent's default data. A parent object and its child (or children) are encapsulated in a container, the first object in which is always the parent object.

To read a custom object from a file, you need to define a read data method for the custom object. To write a custom object to a file, you need to define two I/O methods for the custom object: a traversal method and a write method.

TQ3FileIdleMethod

You can define an idle method to receive occasional callbacks to your application during lengthy file operations.

typedef TQ3Status (*TQ3FileIdleMethod) (
                     TQ3FileObject file,
                     const void *idlerData);
file
A file object.
idlerData
A pointer to an application-defined block of data.

DESCRIPTION

Your TQ3FileIdleMethod function is called occasionally during lengthy file operations. You can use an idle method to provide a method for the user to cancel the lengthy operation (for example, by clicking a button or pressing a key sequence such as Command-period).

If your idle method returns kQ3Success , QuickDraw 3D continues its current operation. If your idle method returns kQ3Failure , QuickDraw 3D cancels its current operation and returns kQ3ViewStatusCancelled the next time you call Q3View_EndWriting .

There is currently no way to indicate how often you want your idle method to be called. You can read the time maintained by the Operating System if you need to determine the amount of time that has elapsed since your idle method was last called.

You must not call any QuickDraw 3D routines inside your idle method.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |